home *** CD-ROM | disk | FTP | other *** search
/ Libris Britannia 4 / science library(b).zip / science library(b) / DJGPP / DJSRC111.ZIP / go32 / dodiff.bat < prev    next >
DOS Batch File  |  1993-08-10  |  1KB  |  52 lines

  1. @echo off
  2.     if _%1==_ goto usage
  3.     if _%2==_ goto usage
  4.  
  5.     basename "set BASENAME=%1" .C >_difftmp.bat
  6.     call _difftmp
  7.     if not _%BASENAME%==_%1 goto gotit
  8.     basename "set BASENAME=%1" .c >_difftmp.bat
  9.     call _difftmp
  10.     if not _%BASENAME%==_%1 goto gotit
  11.     basename "set BASENAME=%1" .H >_difftmp.bat
  12.     call _difftmp
  13.     if not _%BASENAME%==_%1 goto gotit
  14.     basename "set BASENAME=%1" .h >_difftmp.bat
  15.     call _difftmp
  16.     if not _%BASENAME%==_%1 goto gotit
  17.     basename "set BASENAME=%1" .ASM >_difftmp.bat
  18.     call _difftmp
  19.     if not _%BASENAME%==_%1 goto gotit
  20.     basename "set BASENAME=%1" .asm >_difftmp.bat
  21.     call _difftmp
  22.     if not _%BASENAME%==_%1 goto gotit
  23.     basename "set BASENAME=%1" .INC >_difftmp.bat
  24.     call _difftmp
  25.     if not _%BASENAME%==_%1 goto gotit
  26.     basename "set BASENAME=%1" .inc >_difftmp.bat
  27.     call _difftmp
  28.     if not _%BASENAME%==_%1 goto gotit
  29.     echo DODIFF: don't know how to handle files with the extension of "%1"
  30.     goto exit
  31.  
  32. :gotit
  33.     echo ========= [ diff -b %3 %4 %5 %1 %2\%1 ] ============ >_difftmp.dif
  34.     diff -b %3 %4 %5 %1 %2\%1 >>_difftmp.dif
  35.     if not errorlevel 1 goto same
  36.     type _difftmp.dif >>%BASENAME%.dif
  37.     echo diff -b %3 %4 %5 %1 %2\%1: -- files are different, see %BASENAME%.dif
  38.     goto exit
  39.  
  40. :same
  41.     echo diff -b %3 %4 %5 %1 %2\%1: -- files are the same
  42.     goto exit
  43.  
  44. :usage
  45.     echo usage: DODIFF filename compare_directory [diff options]
  46.     goto exit
  47.  
  48. :exit
  49.     rm -f _difftmp.bat _difftmp.dif
  50.     set BASENAME=
  51.  
  52.